package com.asset.dispoal.address.service;

import com.asset.dispoal.address.api.ConvertAreaCodeService;
import com.asset.dispoal.address.dto.ConvertAreaCodeRequest;
import com.asset.dispoal.address.service.commom.ConvertAreaCodeDeleteCommand;
import com.asset.dispoal.address.service.commom.ConvertAreaCodeInsertCommand;
import com.asset.dispoal.address.service.commom.ConvertAreaCodeQueryAllCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;

@Service
public class ConvertAreaCodeServiceImpl implements ConvertAreaCodeService {

    @Autowired
    private ConvertAreaCodeQueryAllCommand areaQueryAllCommand;

    @Autowired
    private ConvertAreaCodeInsertCommand areaInsertCommand;

    @Autowired
    private ConvertAreaCodeDeleteCommand areaDeleteCommand;

    @Override
    public Result queryAll() {
        return areaQueryAllCommand.execute();
    }

    @Override
    public Result insert(ConvertAreaCodeRequest area) {
        return areaInsertCommand.execute(area);
    }


    @Override
    public Result delete(String id) {
        return areaDeleteCommand.execute(id);
    }
}
